<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: a
  Date: 2022/4/17
  Time: 22:42
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>学生信息</title>
    <link href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">

</head>
<body>
<div class="container">
    <div class="row ui-helper-clearfix">
        <div class="col-md-12 column">
            <div class="page-header">
                <h1>
                    <small>展示所有学生</small>
                </h1>
            </div>
        </div>
        <div class="row">
            <div class="col-md-4 column">
                <%--            toAddStudent--%>
                <a class="btn btn-primary" href="${pageContext.request.contextPath}/student/toAddStudent">新增学生</a>
                <a class="btn btn-primary" href="${pageContext.request.contextPath}/student/allStudent">显示全部学生</a>
            </div>
        </div>
    </div>
    <div class="row ui-helper-clearfix">
        <div class="col-md-12 column">
            <table class="table table-hover table-striped">
                <thead>
                <tr>
                    <th>学生序号</th>
                    <th>中文姓名</th>
                    <th>英文姓名</th>
                    <th>家庭住址</th>
                    <th>手机号码</th>
                    <th>出生日期</th>
                </tr>
                </thead>
                <%--                书籍从数据库中查询出来，我们转到前端封装在model里面，叫List
                                     我们要从这个List中遍历出来--%>
                <tbody>
                <c:forEach var="student" items="${list}">
                    <tr>
                        <td>${student.sid}</td>
                        <td>${student.name}</td>
                        <td>${student.english_name}</td>
                        <td>${student.address}</td>
                        <td>${student.phone_number}</td>
                        <td>${student.birthday}</td>
                        <td>
                            <a href="${pageContext.request.contextPath}/student/toUpdateStudent?id=${student.sid}">更新</a>&nbsp;&nbsp;
                        </td>
                    </tr>
                </c:forEach>
                </tbody>
            </table>
        </div>
    </div>

</div>

</body>
</html>
